Release 10.1A: OpenEdge Development:
Web Services


Managing a SOAP fault

On detecting a SOAP fault, OpenEdge automatically creates a SOAP fault object for it. This object contains information from each child element of the response message <Fault> element. Like the ERROR-STATUS handle information, OpenEdge makes this object available only until the next statement executes with the NO-ERROR option.

Table 12–2 lists the attributes on the SOAP fault object, which contains no methods.

Table 12–2: SOAP fault object attributes 
Attribute
Type
Description
SOAP-FAULT-CODE 
CHARACTER 
Returns the value of the <faultcode> element of the SOAP fault message, which identifies the fault.
SOAP-FAULT-STRING 
CHARACTER 
Returns the value of the <faultstring> element of the SOAP fault message, which provides a human-readable description of the fault.
SOAP-FAULT-ACTOR 
CHARACTER 
Returns the value of the <faultactor> element of the SOAP fault message, which is a URI that identifies the Web service returning the fault.
SOAP-FAULT-DETAIL 
HANDLE 
References the SOAP fault-detail object, which contains more application-specific error information.
TYPE 
CHARACTER 
Returns the handle type, "SOAP-FAULT".

As you can see, these attributes provide access to all the elements of a SOAP fault you might encounter.

Because the <detail> element has essentially no standard definition, and can contain any elements that the Web service chooses to generate, OpenEdge provides another object, the SOAP fault-detail object to return this information to the 4GL application. If the SOAP fault message contains a <detail> element, the SOAP-FAULT-DETAIL attribute on the SOAP fault object handle returns a handle to the SOAP fault-detail object that is generated for it. Otherwise, this attribute returns the Unknown value (?). Like the SOAP fault object, OpenEdge makes the SOAP fault-detail object available only until the next 4GL statement that executes with the NO-ERROR option.

Table 12–3 lists the single attribute and Table 12–4 lists the methods of the SOAP fault-detail object.

Table 12–3: SOAP fault-detail object attributes 
Attribute
Type
Description
TYPE 
CHARACTER 
Returns the handle type, "SOAP-FAULT-DETAIL".

Table 12–4: SOAP fault-detail object methods 
Method
Type
Description
GET-NODE( ) 
LOGICAL 
Returns a handle to an X-noderef object that references the root node (SOAP <detail> element) of a DOM tree containing the parsed XML for the underlying SOAP detail information.
GET-SERIALIZED( ) 
LONGCHAR 
Returns the XML for the underlying SOAP fault detail information in serialized form.

The GET-NODE( ) and GET-SERIALIZED( ) methods provide access to the elements of the SOAP fault detail information in exactly the same way as they provide access to SOAP header entries for a SOAP header ( Chapter 11 "Handling SOAP Message Headers in the Progress 4GL").

The general approach to managing SOAP fault detail elements is identical to retrieving and scanning the header entries of a SOAP response header. The structure of elements that make up the SOAP fault detail information is completely undefined. For more information, see the documentation available for the Web service you are accessing.

As with SOAP headers, if the WSDL Analyzer can identify a temp-table or ProDataSet definition that maps to the SOAP fault detail, you can use the GET-SERIALIZED( ) method in conjunction with the READ-XML( ) method of the documented 4GL object (temp-table or ProDataSet) to access the SOAP fault detail data. However, this is unlikely and you most often must access the data using a DOM tree or the 4GL SAX reader. For more information on how the Analyzer might identify a temp-table or ProDataSet to access the SOAP fault detail, see the sections on complex data in Chapter 8, " Analyzing WSDL for Progress 4GL Access to Web Services." For more information on the 4GL DOM, SAX, and temp-table/ProDataSet XML features, see OpenEdge Development: Programming Interfaces .


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095